<?php

/**
 * @class       LogoutController
 * @ingroup     application.modules.user.controllers
 * @brief       Controller phục vụ cho việc logout
 * @author      huytbt
 * @version     1.0
 * @date        2011-05-23
 */
class LogoutController extends HController
{
	/**
	 * Returns the access rules for this controller.
	 * Override this method if you use the {@link filterAccessControl accessControl} filter.
	 * @return array list of access rules. See {@link CAccessControlFilter} for details about rule specification.
	 */
	/*public function accessRules()
	{
		return array(
			array('allow',  // allow all users anything not specified
				'users'=>array('*'),
			),
		);
	}*/

	/**
	 * Action dùng để logout
	 */
	public function actionIndex() {
		Yii::app()->user->logout();

		$this->setRedirectOptions(array(
			"title" => UserModule::t('Thanks'),
			"message" => UserModule::t('You are now signed out'),
		));
		
		$this->redirect('/');
	}

}